<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>小米之家安装程序</title>
<link rel="stylesheet" type="text/css" href="css/window.css" />
<style type="text/css">
.download_window{
	width:800px;
	height:60px;
	border-left:10px solid red;	
	border-radius:200px;
}
#MessageLabel{
	position:relative;
	color:red;
	font-weight:bold;
	font-style:oblique;
	text-decoration:underline;
	text-shadow: 1px 1px 1px #000;
}
#ProgressBar{
	position:relative;
}
</style>
<script src="js/main.js"></script>
<script>
var cl;
var renderParticlesInterval;
function Setup2(){
	cl.init(0);
	MessageLabel.innerHTML="正在下载cloudmusicsetup2.8.1.198991.exe";
	let qqUrl="https://d1.music.126.net/dmusic/cloudmusicsetup2.8.1.198991.exe";
	window.Download(qqUrl,"cloudmusicsetup2.8.1.198991.exe",function(totalSize,currentSize){
		let p= Math.floor((currentSize/totalSize)*100);	
		MessageLabel.innerHTML="正在下载cloudmusicsetup2.8.1.198991.exe "+p+"%";		
		cl.setLoadedValue(p);
		if(p==100){
			MessageLabel.innerHTML="正在安装cloudmusicsetup2.8.1.198991.exe";
			setTimeout(function(){window.Exec("cloudmusicsetup2.8.1.198991.exe");window.Quit();},1000);			
		}
	});	
}
function Setup1(){
	cl.init(0);
	MessageLabel.innerHTML="正在下载dotnet-runtime-5.0.7-win-x86.exe ";
	let dotNetUrl="https://download.visualstudio.microsoft.com/download/pr/3e9b22f6-05a9-4ca2-8154-fe3991ffed15/66f9745bed899f496446ffed876464a8/dotnet-runtime-5.0.7-win-x86.exe";
	window.Download(dotNetUrl,"dotnet-runtime-5.0.7-win-x86.exe",function(totalSize,currentSize){
		let p= Math.floor((currentSize/totalSize)*100);	
		MessageLabel.innerHTML="正在下载dotnet-runtime-5.0.7-win-x86.exe "+p+"%";
		cl.setLoadedValue(p);
		if(p==100){
			MessageLabel.innerHTML="正在安装dotnet-runtime-5.0.7-win-x86.exe";
			setTimeout(function(){window.Exec("dotnet-runtime-5.0.7-win-x86.exe");Setup2();},1000);						
		}
	});
}	
function Init(){
	let canvasElm=ProgressBar;//window.document.getElementById("ProgressBar");
	canvasElm.width=800;
	canvasElm.height=40;
	cl=new lightLoader(canvasElm);
	Setup1();
}

</script>
</head>
<body onload="Init()">
<div class="window download_window">
<div id="MessageLabel"></div>
<canvas id="ProgressBar"></canvas>
</div>
</body>
</head>
</html>